package com.photography.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName("users")
@JsonInclude(JsonInclude.Include.NON_NULL) // 只包含非空字段
public class User {


    @TableId(type = IdType.AUTO)
    private Integer userId;

    private String name;

    private String gender;

    private String phoneNumber;

    private String email;

    private String password;

    private String avatarUrl;

    private String nickname;

    private Integer userLevel = 1;

    private Integer points = 0;

    private String role;

    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date registrationTime;

    @TableField(exist = false)  // 非数据库字段
    private String token;
}
